package org.agile2soft.nexoma.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name = "EXPEDIENT_TYPE_PHASE_EXPEDIENTS")
@SuppressWarnings({"serial"})
public class ExpedientTypePhaseExpedients implements java.io.Serializable {

    private Integer id;
    private InternalUser internalUser;
    private ExpedientType expedientType;
    private Expedient expedient;
    private ExpedientPhase phase;
    private String notes;
    private boolean status;
    private Date startDate;
    private Date endDate;

    public ExpedientTypePhaseExpedients() {
    }

    public ExpedientTypePhaseExpedients(boolean tfeEstado) {
        this.status = tfeEstado;
    }

    public ExpedientTypePhaseExpedients(InternalUser internalUser, ExpedientType expedientType,
            Expedient expedient, ExpedientPhase phase, String notes, boolean status,
            Date createDate, Date endDate) {
        this.internalUser = internalUser;
        this.expedientType = expedientType;
        this.expedient = expedient;
        this.phase = phase;
        this.notes = notes;
        this.status = status;
        this.startDate = createDate;
        this.endDate = endDate;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "TFE_ID", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "USU_LOGIN")
    public InternalUser getInternalUser() {
        return this.internalUser;
    }

    public void setInternalUser(InternalUser internalUser) {
        this.internalUser = internalUser;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "TEX_ID")
    public ExpedientType getExpedientType() {
        return this.expedientType;
    }

    public void setExpedientType(ExpedientType expedientType) {
        this.expedientType = expedientType;
    }

    @ManyToOne
    @JoinColumn(name = "EXP_ID")
    public Expedient getExpedient() {
        return this.expedient;
    }

    public void setExpedient(Expedient expedient) {
        this.expedient = expedient;
    }

    @ManyToOne
    @JoinColumn(name = "FAS_ID")
    public ExpedientPhase getPhase() {
        return this.phase;
    }

    public void setPhase(ExpedientPhase phase) {
        this.phase = phase;
    }

    @Column(name = "TFE_NOTES")
    public String getNotes() {
        return this.notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    @Column(name = "TFE_STATUS", nullable = false)
    public boolean isTfeEstado() {
        return this.status;
    }

    public void setTfeEstado(boolean tfeEstado) {
        this.status = tfeEstado;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "TFE_START_DATE", length = 10)
    public Date getStartDate() {
        return this.startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "TFE_END_DATE", length = 10)
    public Date getEndDate() {
        return this.endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

}
